<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		
	</head>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
		body{
			height: calc(100vh);
			background-image: url(img/backgroud_img.jpg);
			background-size: cover;
		}
	</style>
	<link rel="stylesheet" type="text/css" href="js/layui/css/layui.css"/>
	<script type="text/javascript" src="js/layui/layui.all.js"></script>
	<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<body>
		<div class="layui-container">
			<div  class="layui-row">
				<div class="layui-col-md6 layui-col-lg-offset3" style="margin-top: 100px;">
					<!-- 标题 -->
					<div class="layui-input-block">
						 <div class="title" style="font-size: 2em;text-align: center;"><img src="img/logo.png" >家庭医生签约平台</div>
					</div>	
				</div>
				<div class="layui-col-md6 layui-col-lg-offset3" style="margin-top: 20px;">
					<div class="layui-form">
						<form  action="" method="" class="layui-form ">
							<!-- phone -->
							<div class="layui-form" style="margin: 20px;">
								<label class="layui-form-label">电话：</label>
								<div class="layui-input-block">
									<input type="tel" id="tel" name="tel" class="layui-input" lay-verify="required|phone" lay-reqtext="电话不能空" placeholder="请输入注册电话" autocomplete="off"  />
								</div>
							</div>
							<!-- 身份证 -->
							<div class="layui-form" style="margin: 20px;">
								<label class="layui-form-label">验证码：</label>
								<div class="layui-input-block">
									<input type="text" name="U_id" class="layui-input" lay-verify="required|identity" lay-reqtext="身份证不能空" placeholder="请输入身份证号" autocomplete="off"  />
								</div>
							</div>
							<!-- submit -->
							<div class="layui-form" style="margin: 20px;">
								<div class="layui-input-block">
									<input type="submit"  class="layui-btn"  lay-submit lay-filter="submit_button" style="width: 100% ;background-color: #75c5dc;" value="找回密码"/>
								</div>
							</div>
						</form>
					</div>
					
					<div class="layui-col-md6 layui-col-lg-offset10" style="margin-top: 10px;">
						<a href="login.html">返回登录<i class="layui-icon layui-icon-right"></i></a>
					</div>
				</div>
			</div>
		</div>
		
		<script type="text/javascript">
			layui.use(['layer', 'form', 'element'],function(){
				//加载layui表单元素
				var form = layui.form,
					layer = layui.layer,
					element = layui.element; 
				form.render();
				
				// form.verify({
				//     email:[/([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/,'电子邮箱有误'],
				// 	id: [/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,'身份证有误'],
				// });
				
				form.on("submit(submit_button)", function (data) {
					window.location.href = 'ChangePWD.html?phone='+$("#tel").val();
					//console.log($("#tel").val());
					return false;
					$.ajax({
		                url:'http://123.56.67.48:8080/login',
		                method:'GET',
						data:{
							phone : data.field.phone,
							U_id : data.field.U_id,
							identify : 'doctor'
						},
		          success:function(res){
							console.log("短信发送成功");
							window.location.href = 'ChangePWD.html?phone='+data.field.phone;
						},              
						error:function (res) {
								console.log("失败"); 
		                    }           
					}); 							   
				});
			});
		</script>
	</body>
</html>